/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
import java.util.List;
import java.util.concurrent.*;
import javax.swing.SwingUtilities;
/**
 *
 * @author hbian
 */
public class GuiExecutor extends AbstractExecutorService {
    
    private static final GuiExecutor instance = new GuiExecutor();
    
    private GuiExecutor() {}
    
    public static GuiExecutor instance(){
        return instance;
    }
    
    public void execute(Runnable r){
        if (SwingUtilities.isEventDispatchThread())
            r.run();
        else
            SwingUtilities.invokeLater(r);
    }
    
    //pulis trivial implementation of lifecycle methods

    public void shutdown() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public List<Runnable> shutdownNow() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public boolean isShutdown() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public boolean isTerminated() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public boolean awaitTermination(long l, TimeUnit tu) throws InterruptedException {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}
